package com.lt.contract.service.impl;

import com.lt.contract.entity.NmErpContractRelation;
import com.lt.contract.dao.NmErpContractRelationDao;
import com.lt.contract.service.NmErpContractRelationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * ERP下发合同明细计费方式维护(NmErpContractRelation)表服务实现类
 *
 * @author makejava
 * @since 2020-02-18 21:29:42
 */
@Service("nmErpContractRelationService")
public class NmErpContractRelationServiceImpl implements NmErpContractRelationService {
    @Resource
    private NmErpContractRelationDao nmErpContractRelationDao;


    @Override
    public List<NmErpContractRelation> getContractImportantList(Map<String, Object> map) throws Exception {
        return nmErpContractRelationDao.getContractImportantList(map);
    }

    @Override
    public Long getContractImportantCount(Map<String, Object> map) throws Exception {
        return nmErpContractRelationDao.getContractImportantCount(map);
    }

    @Override
    public int insert(NmErpContractRelation nmErpContractRelation) {
        return nmErpContractRelationDao.insert(nmErpContractRelation);
    }

    @Override
    public int update(NmErpContractRelation nmErpContractRelation) throws Exception {
        return nmErpContractRelationDao.update(nmErpContractRelation);
    }

    /**
     * 通过主键删除数据
     *
     * @param  主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(NmErpContractRelation nmErpContractRelation ) {
        return this.nmErpContractRelationDao.deleteById(nmErpContractRelation) > 0;
    }
}
